﻿@using VirtualPress.Infrastructure.Entities.Enum;
@using VirtualPress.Infrastructure.Entities.Entity;
@using VirtualPress.Tool.Framework;
@{
    ViewBag.Title = "会议管理";
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
@section head{
    <link rel="stylesheet" href="/content/css/uniform.css" />
}
<div id="content-header">
    <h1>
        会议管理</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/press/index" class="tip-bottom"><i class="icon-home"></i>起始页</a>
    <a href="javascript:" class="current">会议管理</a>
</div>

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <h5>
                        会议管理</h5>
                    <div class="buttons" style="margin-right: 15px;">
                        <a href="/WorkSpace/Press/NewMeeting" class="btn btn-success btn-mini"><i class="icon-plus icon-white">
                        </i>新增会议</a>
                    </div>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered">
                        <thead>
                            <tr style="cursor: pointer;">
                                <th style="width: 20%">
                                    会议名称
                                </th>
                                <th style="width: 10%">
                                    行业分类
                                </th>
                                <th style="width: 10%">
                                    管理员账户
                                </th>
                                <th style="width: 33%">
                                    主办单位
                                </th>
                                <th style="width: 15%">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @{ItemListBox<Meeting> data = ViewBag.Meeting;
                              List<Meeting> list = data.Data;}
                            @foreach (var item in list)
                            { 
                                <tr>
                                    <td>
                                        <a target="_blank" href="/conference/detail/@item.Id">@item.Name</a> 
                                        @if (!item.isInstall)
                                        { 
                                            <span style="color:Red; font-size:11px;">[未启用]</span>
                                        }
                                        else
                                        {
                                            <span style="color:Green; font-size:11px;">[已启用]</span>
                                        }
                                    </td>
                                    <td style="text-align: center">
                                        @item.IndType.Mapping()
                                    </td>
                                    <td>
                                        @item.Admin
                                    </td>
                                    <td style="text-align: center">
                                        @item.ZBDW
                                    </td>
                                    <td style="text-align: center">
                                        <a href="/WorkSpace/Press/EditForMeeting/@item.Id" class="btn btn-primary btn-mini">编辑</a>
                                        @if (item.isActive)
                                        {
                                            <a href="/WorkSpace/Press/DisableMeeting/@item.Id" class="btn btn-danger btn-mini">停用</a>
                                        }
                                        else
                                        {
                                            <a href="/WorkSpace/Press/EnableMeeting/@item.Id" class="btn btn-success btn-mini">激活</a>
                                        }
                                        <a onclick="deletemeeting(@item.Id)" class="btn btn-warning btn-mini">删除</a>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
                @Html.Raw(data.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/scripts/jquery.uniform.js"></script>
    <script type="text/javascript" src="/scripts/select2.min.js"></script>
    <script type="text/javascript" src="/scripts/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="/scripts/unicorn.tables.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likmeeting').addClass('open active');
        });
        function deletemeeting(id) {
            if (confirm('确定删除此会议吗？')) {
                window.location.href = "/workspace/press/deletemeeting/" + id;
            }
        }
    </script>
}